package metier;

import java.io.Serializable;

public class IdentifiantCandidature implements Serializable{

	private static final long serialVersionUID = -2899889097486529929L;
	
	private Stage stage = new Stage();
	private Etudiant etudiant = new Etudiant();
	
	public IdentifiantCandidature()
	{
	}
	
	public IdentifiantCandidature(Etudiant pEtudiant, Stage pStage)
	{
		stage = pStage;
		etudiant = pEtudiant;
	}

	public Stage getStage() {
		return stage;
	}

	public Etudiant getEtudiant() {
		return etudiant;
	}

	public void setStage(Stage stage) {
		this.stage = stage;
	}

	public void setEtudiant(Etudiant etudiant) {
		this.etudiant = etudiant;
	}
	
	@Override
	public String toString() {
		return "IdentificationCandidature [etudiant={" + getEtudiant().getIdEtudiant() + "}, stage={" + getStage().getIdStage()+ "}]";
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime
				* result
				+ ((stage.getDescription() == "") ? 0 : stage.getDescription()
						.hashCode());
		result = prime
				* result
				+ ((etudiant.getMdp() == "") ? 0 : etudiant.getMdp()
						.hashCode());
		return result;
	}

}
